<%= error_messages_for "task" %>

<div class="simple_form">
<%= form_tag %>

 <fieldset>
 <div class="form_item">
   <label>Owner</label>
   <select name="task[owner]">
    <option value=""></option>
    <% for user in @active_users %>
     <option value="<%= user.user_id %>"><%= user.username %></option>
    <% end %>
   </select>
 </div>
 <div class="form_item">
  <label>Status</label>
  <select name="task[status_fk]">
   <% for status in @statuses %>
    <option value="<%= status.status_task_id %>"><%= status.name %></option>
   <% end %>
  </select>
 </div>
 <div class="form_item">
   <label>Priority</label>
   <select name="task[priority]">
    <% for priority in (1..10) %>
     <option value="<%= priority %>"><%= priority %></option>   
    <% end %>
   </select>
 </div>
 <div class="form_item">
  <label>Estimated time</label>
  <%= text_field(:task, :estimated_time, :size => 6) %>
  <select name="estimated_time_unit">
   <option value="minutes">minutes</option>
   <option value="hours">hours</option>
  </select> 
 </div>
 <div class="form_item">
  <label>Time worked</label>
  <%= text_field(:task, :time_worked, :size => 6) %>
  <select name="time_worked_unit">
   <option value="minutes">minutes</option>
   <option value="hours">hours</option>
  </select> 
 </div>
 </fieldset> 
 <div class="form_item">
  <label>Subject</label>
  <%= text_field(:task, :subject, :size => 40) %>
 </div>
 <% if @action == 'add_task' %>
   <div class="form_item">
    <label>Description</label>
    <%= text_area(:task, :description, :cols => 100, :rows => 15) %>
   </div>
 <% end %>
 <div class="form_item submit">
  <input type="hidden" name="form_submitted" value="1" />
  <input type="submit" name="submit" value="Save" />
 </div>
<%= end_form_tag %>
</div>
